<style>
    .mt10 {
        margin-top: 10px
    }
</style>
<div class="col-sm-12 mt20">
  <div class="panel panel-body">
    <div class="col-sm-8">
      <div class="col-sm-3">
        <input type="text" class="form-control" ng-model="searchform.create_company_code" placeholder="供应商编号">
      </div>
      <div class="col-sm-3">
        <input type="text" class="form-control" ng-model="searchform.company_code" placeholder="分销商编号">
      </div>
      <div class="col-sm-3">
        <input type="text" class="form-control" ng-model="searchform.view" placeholder="景区编号">
      </div>
      <!-- <div class="col-sm-3">
        <input type="text" class="form-control" ng-model="searchform.sale_code" placeholder="销售品编号">
      </div> -->
      
      <div class="col-sm-3">
        <input type="text" class="form-control" ng-model="searchform.sale_name" placeholder="销售品名称">
      </div>
      <div class="col-sm-3 mt10">
        <ui-select ng-model="searchform.seltype" theme="bootstrap">
          <ui-select-match placeholder="使用时间">{{$select.selected.label}}</ui-select-match>
          <ui-select-choices repeat="item.value as item in chaxunarr | filter: $select.search">
            <span ng-bind-html="item.label | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
      </div>
      <div class="col-sm-3 mt10" ng-show="searchform.seltype == '1'">
        <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="date.lable" 
          is-open="date.opened" ng-click="dateOpen($event, date)" placeholder="开始时间" ng-required="true" 
          close-text="关闭" current-text="今天" clear-text="清除" readonly/>
      </div>
      <div class="col-sm-3 mt10" ng-show="searchform.seltype == '1'">
        <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="date1.lable" 
        is-open="date1.opened" ng-click="dateOpen($event, date1)" placeholder="结束时间" ng-required="true" 
        close-text="关闭" current-text="今天" clear-text="清除" readonly/>						
      </div>
    </div>
    <div class="col-sm-4">
      <div class="col-sm-6">
        <label style="margin-left:20%" class="checkbox-inline" ng-repeat="attr in ticket_arr | filter:{'active': true}">
          <input type="checkbox" ng-model="attr.status" ng-click="checkattr(attr)">{{attr.label}}
        </label>
      </div>
      <div class="col-sm-6">
        <button type="button" class="btn btn-info search form-control" ng-click="load()">立即搜索</button>
      </div>
    </div>
  </div>
  
  <div class="panel panel-default">
    <table class="table table-striped table-bordered">
      <thead>
        <tr>
          <th class="text-center" style="width: 10%">时间</th>
          <th class="text-center" style="width: 20%">销售品名称</th>
          <th class="text-center" style="width: 8%">供应商</th>
          <th class="text-center" style="width: 8%">分销商</th>
          <th class="text-center" style="width: 6%">购买数量</th>
          <th class="text-center" style="width: 6%">使用数量</th>
          <th class="text-center" style="width: 6%">退票数量</th>
          <th class="text-center" style="width: 5%">分销价</th>
          <th class="text-center" style="width: 6%">分销总计</th>
          <th class="text-center" style="width: 5%">采购价</th>
          <th class="text-center" style="width: 6%">采购总计</th>
          <th class="text-center" style="width: 8%">详情</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="obj in objs | filter:{'show': true}">
          <td class="text-center">{{obj.date}}</td>
          <td class="">{{obj.sale_name}}<br>销售品编号:{{obj.sale_code}}</td>
          <td class="text-center">{{obj.create_company_name}}<br>{{obj.create_company_code}}</td>
          <td class="text-center">{{obj.company_name}}<br>{{obj.company_code}}</td>
          <td class="text-center">{{obj.buy}}</td>
          <td class="text-center">{{obj.used}}</td>
          <td class="text-center">{{obj.back}}</td>
          <td class="text-center">{{obj.unit_price * 0.01 | currency : '￥'}}</td>
          <td class="text-center">{{(obj.total_buy - obj.total_back) * 0.01 | currency : '￥'}}</td>
          <td class="text-center">{{obj.purchase_price * 0.01 | currency : '￥'}}</td>
          <td class="text-center">{{obj.total_purchase_price * 0.01 | currency : '￥'}}</td>
          <td class="text-center">
            <a ng-click="detail(obj)" ng-hide="obj.used == 0" class="btn btn-success btn-sm">使用详情</a>
          </td>
        </tr>
        <tr >
          <td class="text-center">总计</td>
          <td></td>
          <td></td>
          <td></td>
          <td class="text-center">{{total.buy}}</td>
          <td class="text-center">{{total.used}}</td>
          <td class="text-center">{{total.back}}</td> 
          <td class="text-center"></td>
          <td class="text-center">{{total.total * 0.01 | currency : '￥'}}</td>
          <td class="text-center"></td>
          <td class="text-center">{{total.purchase_total * 0.01 | currency : '￥'}}</td>
          <td></td>
        </tr>
      </tbody>
    </table>

  </div>
</div>